#!/bin/bash
#

while read line; do
    name=$(echo $line | awk -F: '{print $1}')
    passwd=$(echo $line | awk -F: '{print $2}')
    uid=$(echo $line | awk -F: '{print $3}')
    gid=$(echo $line | awk -F: '{print $4}')
    comment=$(echo $line | awk -F: '{print $5}')
    home=$(echo $line | awk -F: '{print $6}')
    shell=$(echo $line | awk -F: '{print $7}')
    mysql -uroot -pWWW.1.com -e "insert into ly.passwd(name,password,uid,gid,comment,home,shell) values('$name','$password',$uid,$gid,'$comment','$home','$shell')"
done < /etc/passwd
